﻿@using hc.epm.Common;
@using hc.Plat.Common.Extend
@using hc.epm.DataModel.Business;
@model Epm_TzPeopleChgApply
<link href="~/Resource/css/ProjectManagement.css" rel="stylesheet" />
<style>
    .fr-ta {
        width: 100%;
    }

    .ou-ta div {
        width: 125px;
    }

    .tab-conten input[type=text] {
        width: 125px;
        height: 29px;
        padding-left: 3px;
        border-radius: 3px;
        border: 1px solid;
        box-sizing: border-box;
    }
    .file-wrap {
        height: 35px;
        width: 300px;
        margin-top: 5px;
        margin-left: 34px;
        border: 1px solid #D9D8D8;
        line-height: 35px;
        border-radius: 5px;
    }

    .fileShow {
        height: auto;
        overflow: hidden;
    }

        .fileShow li {
            width: 50%;
            float: left;
            text-align: left;
            padding-left: 34px;
            color: blue;
            height: 30px;
            line-height: 30px;
            cursor: pointer;
        }

            .fileShow li span {
                display: inline-block;
                height: 100%;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .fileShow li i {
                color: black;
            }
</style>

<div class="contentData">
    <form class="form-horizontal" id="mainForm">
        <div class="module-div">
            <h4>基础信息</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">标题</span>
                        </td>
                        <td class="td-div">
                            <span>@Model.Title</span>
                        </td>
                        <td class="table_title">
                            <span class="font-black">申请人</span>
                        </td>
                        <td class="td-div">
                            <span>@Model.Applicant</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">申请部门</span>
                        </td>
                        <td class="td-div">
                            <span>@Model.CompanyName</span>
                            <span>@Model.Department</span>
                        </td>
                        <td class="table_title">
                            <span class="font-black">申请时间</span>
                        </td>
                        <td class="td-div">
                            <div>@(Convert.ToDateTime(Model.ApplyDate).ToString("yyyy-MM-dd"))</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">项目名称</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.ProjectName</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">建设地址</span>
                        </td>
                        <td class="td-div" colspan="3">
                            <div class="form-group">@Model.ConstructionAddress</div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">施工（监理）单位</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">@Model.WorkUnit</div>
                        </td>
                        <td class="table_title">
                            <span class="font-black">负责人</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">@Model.Leader</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="module-div">
            <h4>人员变更情况</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td colspan="4">
                            <table class="fr-ta" style="word-break:break-all;word-wrap:break-word;">
                                <thead>
                                    <tr class="ou-ta">
                                        <th><div style="width:40px;">序号</div></th>
                                        <th><div>变更岗位</div></th>
                                        <th><div>变更前人员</div></th>
                                        <th><div style="width:200px;">变更前职业证书名称</div></th>
                                        <th><div>变更后人员</div></th>
                                        <th><div style="width:200px;">变更后职业证书名称</div></th>
                                    </tr>
                                </thead>
                                <tbody class="addtab">
                                    @{
                                        int index = 0;
                                    }
                                    @if (Model.TzPeopleChgApplyItem != null && Model.TzPeopleChgApplyItem.Count() > 0)
                                    {
                                        foreach (var item in Model.TzPeopleChgApplyItem)
                                        {
                                            index++;
                                            <tr class="tab-conten">
                                                <td class="number">@index</td>
                                                <td>@item.ChgPost</td>
                                                <td>@item.ChgPeopleBefore</td>
                                                <td>@item.ChgCertiNameBefore</td>
                                                <td>@item.ChgPeopleAfter</td>
                                                <td>@item.ChgCertiNameAfter</td>
                                            </tr>
                                        }
                                    }
                                </tbody>
                            </table>
                        </td>
                    </tr>
                    <tr>
                        <td class="bold-name">附件</td>
                        <td colspan="3">
                            <!--附件-->
                            <div>
                                <div style="width:100%; margin-top:5px;" id="fileList">
                                    <ul class="fileShow">
                                        @if (Model.TzAttachs != null && Model.TzAttachs.Count() > 0)
                                        {
                                            foreach (var item in Model.TzAttachs)
                                            {
                                                <li>
                                                    <span class="downloadfile" data-url="@item.FilePath" data-filename="@item.Name">@item.Name</span>
                                                </li>
                                            }
                                        }
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="table_title">
                            <span class="font-black">部门负责人</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">@Model.DepLeaderName</div>
                        </td>
                        <td class="table_title">
                            <span class="font-black">分管领导</span>
                        </td>
                        <td class="td-div">
                            <div class="form-group">@Model.LeaderName</div>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="module-div">
            <h4>签字意见</h4>
            <table class="datalist" style="word-break:break-all;word-wrap:break-word;margin-top:10px;">
                <tbody>
                    <tr>
                        <td colspan="4">@Html.Raw(Model.SignIdea)</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <div class="layui-form-item  btn-save" style="margin-top:60px;text-align:center;">
            <input type="button" id="close" value="关&nbsp;&nbsp;&nbsp;闭" class="layui-btn layui-btn-big button-base bg-cancel cancel" />
        </div>
    </form>
</div>
<script>
    //下载附件
    $("body").on("click", ".downloadfile", function () {
        var path = $(this).data("url");
        var fileName = $(this).data("filename");
        window.location.href = "/Download/DownLoadHB?path=" + path + "&fileName=" + fileName;
    });
    //关闭
    $("#close").click(function () {
        window.location.href = "/TzPeopleChgApply/Index";
    });
</script>